package com.example.controller;

import com.example.pojo.Maintenancestaff;
import com.example.pojo.Result;
import com.example.service.impl.MaintenancestaffServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/serviceman")
@RestController
public class MaintenancestaffController {
    @Autowired
    private MaintenancestaffServiceImpl maintenancestaffService;

    //显示维修人员
    @GetMapping
    public Result getServiceman(){
        List<Maintenancestaff> maintenancestaff=maintenancestaffService.getserviceman();
        return Result.success(maintenancestaff);
    }

    //显示空闲维修人员
    @GetMapping("/leisure")
    public Result getServicemanLeisure(){
        List<Maintenancestaff> maintenancestaffs=maintenancestaffService.getServicemanLeisure();
        return Result.success(maintenancestaffs);
    }

}
